package exemple;


import com.thirdnf.ResourceScheduler.Appointment;
import com.thirdnf.ResourceScheduler.components.AbstractAppointmentComponent;
import com.thirdnf.ResourceScheduler.components.BasicComponentFactory;


/**
 * This is the example component factory which is used to create custom resource and appointment components.
 *
 * @author Joshua Gerth - jgerth@thirdnf.com
 */
public class ExampleComponentFactory extends BasicComponentFactory
{
    // The appointment listener to call for mouse clicks on the appointments.
    private AppointmentListener _appointmentListener;



    public AbstractAppointmentComponent makeAppointmentComponent(Appointment appointment)
    {
        ExampleAppointmentComponent component = new ExampleAppointmentComponent(appointment);
        component.setAppointmentListener(_appointmentListener);

        return component;
    }


    /**
     * Set the appointment listener.  This will be passed into every appointment component which
     * is created.
     *
     * @param appointmentListener (not null) The listener to call for mouse clicks on the appointments.
     */
    public void setAppointmentListener(AppointmentListener appointmentListener)
    {
        _appointmentListener = appointmentListener;
    }


}
